import { Injectable } from "@angular/core";
import { HttpClient } from "@angular/common/http";

@Injectable({
  providedIn: 'root'
})
export class ConfigShortAddressGroupService {
  /**
   * 查询地址
   */
  public GET_URL = "/shortUrlGroup/list";
  /**
   * 新增地址
   */
  public save_URL = "/shortUrlGroup/save";
  /**
   * 修改地址
   */
  public edit_URL = "/shortUrlGroup/update";
  /**
   * 删除地址
   */
  public delete_URL = "/shortUrlGroup/delete";


  constructor(public httpClient: HttpClient) { }

  /**
  * 查询地址
  * @param json 参数
  */
  public async getList(params: any) {
    return this.httpClient.post(this.GET_URL, params).toPromise()
  }

  /**
    * 保存地址
    * @param json 参数
  */
  public async save(params: any) {
    return this.httpClient.post(this.save_URL, params).toPromise()
  }

  /**
  * 编辑地址
  * @param json 参数
  */
  public async edit(params: any) {
    return this.httpClient.post(this.edit_URL, params).toPromise()
  }

  /**
  * 删除地址
  * @param json 参数
  */
  public async delete(params: any) {
    return this.httpClient.post(this.delete_URL, params).toPromise()
  }
}
